<?php

class news extends MX_Controller {

    function __construct() {
        parent::__construct();
        $this->load->model('news_model');
    }

    function index() {
        $data['menu_item'] = 0;
        $arr_news = $this->news_model->get_news(0, 11);
        $data['arr_news'] = $arr_news;
        $this->load->view('news_index',$data);
    }
    
    function loadmore($ofset)
    {
        $arr_news = $this->news_model->get_news($ofset, 11);
        echo json_encode($arr_news);
    }
    
    function detail($id)
    {
        $data['menu_item'] = 0;
        $news = $this->news_model->get($id);
        $data['news'] = $news;            
        $this->load->view('van_chuong', $data);
    }

}

?>
